import requests


class ScaLoginApi(object):
    # 登录方法
    @classmethod
    def login(cls, json_data):
        url = "http://10.10.101.161:9778/cleansourcesca/api/v2/user/login"
        header = {"Content-Type": "application/x-www-form-urlencoded"}
        resp = requests.post(url=url, headers=header, data=json_data)
        return resp


if __name__ == '__main__':
    data = {"user_name": "liyajun",
            "password": "CP8LujbNs7JD36NJcjsXj6EQuss6D/EqiC8Z/HatLYZ4eSgo+tuRBYTF5Gksf5f4jkHi8D50jyprvGXYvFCurNkxKzZ6nUP3EB3z4BkoX+06VQoe2wWIoyQgP37c2fi2CgXAYYcR03ykqv6WK/LmeGWz0fst78SfhyjlQGes2Rhs63WFDR6I6ulMrfpN9H/ngh8zUt97rDP5FezxdccKTwgNXXoSXMkN53ch/DcQ/bL6hvIY6BjwMDInyQHtVU4rkEGKl/p0NG3duOUvqBj/rflWvbM1Fqrk+8TtZu3fY/jBdRrWuW8Nqn//BfoLOLh3LBFbg9Z3tIrT8bLM//KbTg=="}
    resp = ScaLoginApi.login(data)
    print(resp.json())
